/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import model.xml.ParseXML;
import entities.vo.Articulo;
import entities.vo.ArticuloEnvtVO;
import entities.vo.ENVTVO;

/**
 *
 * @author Jhonny
 */
public class ModelRecibirENVT extends Model{

    public ModelRecibirENVT(ModelMain model) {

    }

    public ENVTVO getENVT(String path) throws FileNotFoundException, IOException {
        ParseXML parse = new ParseXML();
//        List<ArticuloEnvtVO> list = null;
//        List<ArticuloStockVO> stocks=null;
        ENVTVO envt=null;
        envt = parse.getArticulosENVT(path);
        //stocks = envt.getArticulos();
//        if(stocks!=null){
//            ArticuloEnvtVO articulo=null;
//            list = new LinkedList<ArticuloEnvtVO>();
//            for (ArticuloStockVO articuloStock : stocks) {
//                articulo = new ArticuloEnvtVO();
//                articulo.setReferencia(articuloStock.getReferencia());
//                articulo.setCantidadRecibida(articuloStock.getStock());
//                list.add(articulo);
//            }
//        }
        return envt;
    }

    

    public void recibirENVT(List<Articulo> articulos) {
        throw new UnsupportedOperationException("Not yet implemented");
    }

	public String recibirENVT(ENVTVO envt) throws Exception{
		return fachada.recibirENVT(envt);
		
	}

	public List<ArticuloEnvtVO> getArticulosENVT(List<ArticuloEnvtVO> articulos) {		
		return fachada.getArticulosENVT(articulos);
	}

}
